<!-- 基本设置 -->
<div class="panel-body form-horizontal tab-pane in fade active" id="cardBasic">
	<!-- 名称 -->
	<div class="wn-edit-head">
		基本设置
	</div>
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label">名称<span style="color:red">*</span></label>
		<div class="col-sm-9 col-xs-12">
			<input type="text" class="form-control" v-model="activeModules.cardBasic.params.title" style="">
		</div>
	</div>
	<!-- 背景 -->
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label">背景图案<span style="color:red">*</span></label>
		<div class="col-sm-9 col-xs-12">
			<label class="radio-inline">
				<input type="radio" value="system" v-model="activeModules.cardBasic.params.background.type" name="37" style=""> 系统
			</label>
			<label class="radio-inline">
				<input type="radio" value="user" v-model="activeModules.cardBasic.params.background.type" 	name="38" style="">
				自定义
			</label>
		</div>
	</div>
	<!-- 背景图片 -->
	<div class="form-group" v-if="activeModules.cardBasic.params.background.type == 'user'">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
		<div class="col-xs-9">
			<span @click="addBgThumb()" class="form-control-static"><i class="fa fa-plus-circle green"></i>&nbsp;选择图片</span>
			<div style="margin-top: 0.5em;" class="input-group" v-show="activeModules.cardBasic.params.background.image"><img width="150" class="img-responsive img-thumbnail" :src="activeModules.cardBasic.params.background.image"> <em @click="activeModules.cardBasic.params.background.image = '';" title="删除这张图片" style="position:absolute; top: 0px; right: -14px"
					class="close">×</em>
			</div>
		</div>
	</div>
	<div class="form-group" v-if="activeModules.cardBasic.params.background.type == 'system'">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
		<div class="col-sm-9 col-xs-12">
			<select class="form-control" v-model="activeModules.cardBasic.params.background.image" style="">
				<option :value="'../addons/wn_storex/template/style/img/card/'+ i + '.png'" v-for="i in 23">背景{{i}}</option>
			</select>
		</div>
	</div>
	<!-- Logo -->
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label">LOGO<span style="color:red">*</span></label>
		<div class="col-sm-9 col-xs-12">
			<span @click="addThumb('logo')" class="form-control-static"><i class="fa fa-plus-circle green"></i>&nbsp;选择图片</span>
			<div style="margin-top: 0.5em;" class="input-group" v-show="activeModules.cardBasic.params.logo">
				<img width="150" class="img-responsive img-thumbnail" :src="activeModules.cardBasic.params.logo">
				<em @click="activeModules.cardBasic.params.logo = '';" title="删除这张图片" style="position:absolute; top: 0px; right: -14px" class="close">×</em>
			</div>
		</div>
	</div>
	<!-- 会员卡等级 -->
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label">会员卡等级</label>
		<div class="col-sm-9 col-xs-12">
			<label class="radio-inline">
				<input type="radio" value="1" v-model="activeModules.cardBasic.params.card_level.type" class="n" name="39" style=""> 开启
			</label>
			<label class="radio-inline">
				<input type="radio" value="2" v-model="activeModules.cardBasic.params.card_level.type" class="" name="40" style=""> 关闭
			</label>
		</div>
	</div>
	<!-- 会员卡等级颜色 -->
	<div class="form-group" v-show="activeModules.cardBasic.params.card_level.type == '1'">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
		<div class="col-sm-9 col-xs-12">
			<br>
			<div class="">
				<div class="input-group">
					<input type="text" name="" value="" v-model="activeModules.cardBasic.params.color.rank" class="form-control" style="">
					<span class="input-group-addon" style="width: 35px; border-left: none;" :style="{'background-color' : activeModules.cardBasic.params.color.rank}"></span>
					<span class="input-group-btn">
						<button class="btn btn-default colorpicker" v-colorpicker="{'object': activeModules.cardBasic.params.color, 'key': 'rank'}"  type="button">选择颜色 <i class="fa fa-caret-down"></i></button>
						<button class="btn btn-default colorclean" @click="activeModules.cardBasic.params.color.rank = ''" type="button"><span><i class="fa fa-remove"></i></span></button>
					</span>
				</div>
			</div>
		</div>
	</div>
	<!-- 会员卡标题 -->
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label">会员卡标题</label>
		<div class="col-sm-9 col-xs-12">
			<label class="radio-inline">
				<input type="radio" value="1" v-model="activeModules.cardBasic.params.card_label.type" class="ng-pristine ng-untouched ng-valid ng-not-empty" name="41" style=""> 开启
			</label>
			<label class="radio-inline">
				<input type="radio" value="2" v-model="activeModules.cardBasic.params.card_label.type" class="ng-pristine ng-untouched ng-valid ng-not-empty" name="42" style=""> 关闭
			</label>
		</div>
	</div>
	<!-- 会员卡标题颜色 -->
	<div class="form-group" v-show="activeModules.cardBasic.params.card_label.type == '1'">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
		<div class="col-sm-9 col-xs-12">
			<input type="text" v-model="activeModules.cardBasic.params.card_label.title" class="form-control">
			<br>
			<div class="">
				<div class="input-group">
					<input type="text" name="" value="" v-model="activeModules.cardBasic.params.color.title" class="form-control" style="">
					<span class="input-group-addon" style="width: 35px; border-left: none;" :style="{'background-color' : activeModules.cardBasic.params.color.title}"></span>
					<span class="input-group-btn">
						<button class="btn btn-default colorpicker" v-colorpicker="{ 'object': activeModules.cardBasic.params.color,'key': 'title'}" type="button">选择颜色 <i class="fa fa-caret-down"></i></button>
						<button class="btn btn-default" @click="activeModules.cardBasic.params.color.title = ''" type="button"><span><i class="fa fa-remove"></i></span></button>
					</span>
				</div>
			</div>

		</div>
	</div>
	<!-- 使用说明 -->
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label">使用说明<span style="color:red">*</span></label>
		<div class="col-sm-9 col-xs-12">
			<textarea class="form-control" rows="6" v-model="activeModules.cardBasic.params.description" style=""></textarea>
			<span class="help-block">请填写会员卡的使用说明。</span>
		</div>
	</div>
	<!-- 会员卡资料 -->
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label">会员卡资料</label>
		<div class="col-sm-10 col-xs-9">
			<div v-for="(field, index) in activeModules.cardBasic.params.fields" style="margin-left: -15px;">
				<div class="col-sm-10" style="margin-bottom:10px">
					<div class="input-group">
						<input type="text" class="form-control" v-model="field.title" :disabled="(field.bind == 'realname' || field.bind == 'mobile') && index <= 1">
						<span class="input-group-addon">
							<label>
								<input type="checkbox" v-model="field.require" :disabled="(field.bind == 'realname' || field.bind == 'mobile') && index <= 1" class=""> 必填
							</label>
						</span>
						<select v-model="field.bind" class="form-control" :disabled="(field.bind == 'realname' || field.bind == 'mobile') && index <= 1">
							<option :value="key" v-for="(fansfield, key) in fansFields" class="" selected="selected">{{fansfield.title}}</option>
						</select>
					</div>
				</div>
				<div class="col-sm-1" style="margin-top:5px" v-show="field.bind != 'mobile' && field.bind != 'realname'"><a href="javascript:;" @click="removeFields(field.bind, index);"><i class="fa fa-times-circle"></i></a></div>
			</div>
			<span class="help-block col-sm-9" style="margin-left:-15px">
				系统会自动绑定：真实姓名和手机号码，最多可添加5个。
			</span>
			<span class="help-block col-sm-9" style="margin-left:-15px">
				 <a href="javascript:;" @click="addFields();" v-if="activeModules.cardBasic.params.fields.length < 5">
					 <i class="fa fa-plus-circle" title="添加填写项目"></i>
					 添加填写项目
				 </a>
			 </span>
		</div>
	</div>
	<!-- 领卡赠送 -->
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label">领卡赠送<span style="color:red">*</span></label>
		<div class="col-sm-9 col-xs-12">
			<div class="input-group">
				<span class="input-group-addon" ng-init="activeModules.cardBasic.params.grant &amp;&amp; activeModules.cardBasic.params.grant == 0 ? activeModules.cardBasic.params.grant = {} : ''">赠送</span>
				<input type="text" v-model="activeModules.cardBasic.params.grant.credit1" class="form-control" style="">
				<span class="input-group-addon">积分</span>
			</div>
		</div>
	</div>
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
		<div class="col-sm-9 col-xs-12">
			<div class="input-group">
				<span class="input-group-addon">赠送</span>
				<input type="text" v-model="activeModules.cardBasic.params.grant.credit2" class="form-control" style="">
				<span class="input-group-addon">余额</span>
			</div>
		</div>
	</div>
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
		<div class="col-sm-9 col-xs-12">
			<div class="input-group">
				<input type="hidden" v-model="activeModules.cardBasic.params.grant.coupon" class="ng-pristine ng-untouched ng-valid ng-not-empty" style="">
				<span class="input-group-addon">已选:
					<span>{{coupon_list}}</span>
				</span>
				<span class="input-group-btn">
					<button class="btn btn-primary" type="button" @click="selectCoupon();">搜索优惠券</button>
					<button class="btn btn-default" type="button" ng-click="clearCoupon();">
						<span><i class="fa fa-remove"></i></span>
					</button>
				</span>
			</div>
			<div class="help-block"><a href="./index.php?i=281&amp;j=269&amp;c=activity&amp;a=coupon" target="_blank">添加优惠券</a>.注意:赠送的优惠券应该各个会员组都可以领取.否则会造成赠送失败的问题</div>
		</div>
	</div>
	<!-- 抵现比率 -->	
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label">抵现比率<span style="color:red">*</span></label>
		<div class="col-sm-9 col-xs-12">
			<div class="input-group">
				<input type="text" v-model="activeModules.cardBasic.params.offset_rate" class="form-control" style=""> <span class="input-group-addon">积分抵 1 元</span>
			</div>
			<br>
			<div class="input-group">
				<span class="input-group-addon">单次最多可抵现</span>
				<input type="text" v-model="activeModules.cardBasic.params.offset_max" class="form-control" style=""> <span class="input-group-addon">元</span>
			</div>
			<div class="help-block">
				<strong class="text-danger">例:积分抵现金比率:100积分抵1元,那用户在消费的时候,将可用账户积分抵消部分金额.</strong>
			</div>
			<div class="help-block">
				<strong class="text-danger">目前仅支持后台交易抵现，暂不支持手机交易抵现.</strong>
			</div>
		</div>
	</div>
</div>
